package com.guigu.www.web.controller;


import com.guigu.www.dao.bean.Dept;
import com.guigu.www.dao.bean.Employee;
import com.guigu.www.dao.mapper.DeptMapper;
import com.guigu.www.service.pojo.EmployeeAndDept;
import com.guigu.www.service.pojo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author WangChenZhen
 * @since 2021-03-17
 */
@RestController()
public class DeptController {
    @Autowired
    DeptMapper mapper;

    Integer a=0;


    @PostMapping("load")
    public Integer load(){
        return a;
    }
    @PostMapping("test")
    public void test(){
        a++;
    }
    @PostMapping("jian")
    public void jian(Integer b){
        a-=b;
    }


    @PostMapping("deptShowALl")
    public List<Dept> deptShowALl(){
        return mapper.selectList(null);
    }

    @PostMapping("one")
    public List<Dept> aaaa(@RequestBody Dept dept){
        System.out.println(dept);
        return mapper.selectList(null);
    }
}

